<template>
	<div class="app">
		<h2>我是App组件 (父组件))</h2>
		<br>
		<h3>School组件 (子组件) 给我的学校名是: {{schoolName}}</h3>
		<br>
		<School ref="school" />
	</div>
</template>

<script>
	import School from './components/School'
	
	export default {
		name: 'App',
		components: {School},
		data(){
			return{
				schoolName: ''
			}
		},
		mounted(){
			this.$refs.school.$on('delivery',(val)=>{
				this.schoolName = val
			})
		}
	}
</script>

<style>
	.app{
		background-color: #aaa;
		padding: 20px;
	}
</style>